﻿using System;
using System.Collections.Generic;
using System.Text;
using Ghasam.Business.Domain.Entity;
using Ghasam.Business.DAO;
using Spring.Transaction.Interceptor;

namespace Ghasam.Business.Services.Impl
{
    public class InternalAccountService:IInternalAccountService
    {
        private IInternalAccountDao iInternalAccountDao;
        public IInternalAccountDao IInternalAccountDao
        {
            set { iInternalAccountDao = value; }
            get {return iInternalAccountDao; }
        }

        [Transaction(ReadOnly = false)]
        public void InternalAccountSaveOrUpadate(string name, int balance, string description, DateTime createDate, DateTime modifyDate)
        {
            InternalAccount internalAccount = new InternalAccount();
            internalAccount.Name = name;
            internalAccount.Balance = balance;
            internalAccount.Description = description;
            internalAccount.CreateDate = createDate;
            internalAccount.ModifyStamp = modifyDate;
            IInternalAccountDao.SaveOrUpdate(internalAccount);
 
        }
    }
}
